<?php
/*========================================= JooSam =========================================/
/																							/
/	Extention:		JooSam																	/
/	Created by:		Broadcastweb.eu - Paules												/
/	Site:			http://www.broadcastweb.eu												/
/	Email:			support@broadcastweb.eu													/
/	Copyright:		2011 - 2012 (c) Broadcastweb.eu											/
/	License:		CC BY-NC-ND 3.0 ~ http://creativecommons.org/licenses/by-nc-nd/3.0/		/
/	File Version:	0003																	/
/																							/
/========================================== JooSam ========================================*/
// Joomla security
defined('_JEXEC') or die;

$settings = $this->settings;
$songid = JRequest::getVar('jsm_hidden_songid', 0);
$pre_html = $settings->request->song_info_layout;
$hold_image = '{jsm_loadimage}';
$hold_title = '{jsm_loadtitle}';
$hold_artist = '{jsm_loadartist}';
$hold_songtext = '{jsm_loadsongtext}';
$hold_played = '{jsm_loadplayed}';
$hold_rating = '{jsm_loadrating}';
$hold_descr = '{jsm_loaddescr}';
$hold_duration = '{jsm_loadduration}';
$hold_buy = '{jsm_loadbuybutton}';
$hold_req = '{jsm_loadrequest}';

$html_image = $this->getdata->jsm_replace('loadimage');
$html_title = $this->getdata->jsm_replace('loadtitle');
$html_artist = $this->getdata->jsm_replace('loadartist');
$html_songtext = $this->getdata->jsm_replace('loadsongtext');
$html_played = $this->getdata->jsm_replace('loadplayed');
$html_rating = $this->getdata->jsm_replace('loadrating');
$html_descr = $this->getdata->jsm_replace('loaddescr');
$html_duration = $this->getdata->jsm_replace('loadduration');
$html_buy = $this->getdata->jsm_replace('loadbuybutton');
$html_req = $this->getdata->jsm_replace('loadrequest');

$hold = array($hold_image, $hold_title, $hold_artist, $hold_songtext, $hold_played, $hold_rating, $hold_descr, $hold_duration, $hold_buy, $hold_req);
$html = array($html_image, $html_title, $html_artist, $html_songtext, $html_played, $html_rating, $html_descr, $html_duration, $html_buy, $html_req);
$output = str_replace($hold, $html, $pre_html);

$image_holders = array('{load_height}', '{load_width}');
$image_replace = array('150px', '150px');
$result = str_replace($image_holders, $image_replace, $output);

echo $result;

?>
<script>
function jsm_makerequest(sid){
	var loader = document.getElementById('jsm_pageload');
	var songID = document.getElementById('jsm_songid');
	if(sid != 0){
		loader.value = 'request';
		songID.value = sid;
		document.jsm_songlist_headerform.submit();
	} else{
		return false;
	}
}
</script>